function Tab(id, name, yqlRequest) {
	// Properties
	this.id = id;
	this.name = name;
	this.yqlRequest = yqlRequest;
	this.data = yqlRequest.parser;
	
	// Methods
	this.Update = function(dom) {
		this.data.Print(dom);
	};
};

function Tabs() {
	// Properties
	var tabs = new Object();
	
	// Methods
	this.CreateTab = function(id, name, request) {
		tabs[id] = new Tab(id, name, request);
	};

	this.UpdateTab = function(id, dom, callback) {
		if (user.IsAuthenticated()) {
			if ((new Date() - (60 * 1000)) > tabs[id].data.last_updated) { // more than 1 minute since last update
				tabs[id].yqlRequest.onReady = callback;
				yqlHandler.MakeRequest(tabs[id].yqlRequest);
				return true;
			} else {
				tabs[id].Update(dom);
			}
		}
		
		return false;
	};
	
	this.GetTabs = function() {
		return tabs;
	};
};